package managerInterface;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class Test {

	public static void main(String[] args) throws Exception{
		int height = 200;
		int width = 200;
		Color colorTitle = Color.lightGray;
		String title = "Khoa Công Nghệ Thông Tin";
		String iD = "iD";
		String name = "name";
		String numStudent = "number of student";
		String numTeacher = "number of teacher";
		tableComponent com1 = new tableComponent(height, width, colorTitle, title, iD, name, numStudent, numTeacher);
		tableComponent com2 = new tableComponent(height, width, colorTitle, title, iD, name, numStudent, numTeacher);
		tableComponent com3 = new tableComponent(height, width, colorTitle, title, iD, name, numStudent, numTeacher);
		tableComponent com4 = new tableComponent(height, width, colorTitle, title, iD, name, numStudent, numTeacher);
		tableComponent com5 = new tableComponent(height, width, colorTitle, title, iD, name, numStudent, numTeacher);
		tableComponent com6 = new tableComponent(height, width, colorTitle, title, iD, name, numStudent, numTeacher);
		
		JFrame frame = new JFrame();
			
		//frame.setPreferredSize(new Dimension(500, 500));
		
		//frame.setLayout(new GridLayout(2, 2));
		
		JPanel panel = new JPanel();
		panel.setLayout(new GridLayout(3, 3));
		
		panel.add(com1.getComponentPanel());
		panel.add(com2.getComponentPanel());
		panel.add(com3.getComponentPanel());
		panel.add(com4.getComponentPanel());
		panel.add(com5.getComponentPanel());
		panel.add(com6.getComponentPanel());
		JScrollPane scrPane = new JScrollPane(panel);
		frame.setSize(new Dimension(500, 500));
		
		
		frame.add(scrPane);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(3);// 3 = EXIT_ON_CLOSE, nhưng nó k chịu nhận
	}

}
